package com.lvw.weather.forcast.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Receiver {
    public static final Logger log = LoggerFactory.getLogger(Receiver.class);

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("hello"),
            exchange = @Exchange("myExchange")
    ))
    public void process(String msg) {
        log.info("===> Receive msg: " + msg);
    }
}
